﻿Public Class EditProfessor
    Public Response As MessageBoxResult = MessageBoxResult.Cancel
    Private prof As Professor

    Public Sub New(ByRef value As Professor)
        InitializeComponent()

        prof = value
        fillForm()
    End Sub

    Public Sub fillForm()
        professorName.Text = prof.name
        professorWebsite.Text = prof.website
        professorEmail.Text = prof.email
        professorNotes.Text = prof.notes
    End Sub

    Public Sub OK_Click()
        saveForm()
        Response = MessageBoxResult.OK
        Me.Hide()
    End Sub

    Public Sub Cancel_Click()
        Response = MessageBoxResult.Cancel
        Me.Hide()
    End Sub

    Public Sub saveForm()
        prof.name = professorName.Text
        prof.website = professorWebsite.Text
        prof.email = professorEmail.Text
        prof.notes = professorNotes.Text
    End Sub
End Class
